package com.game.eggscatcher.Screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.game.eggscatcher.GameHelpers.InputHandler;
import com.game.eggscatcher.GameWorld.GameRenderer;
import com.game.eggscatcher.GameWorld.GameWorld;

public class GameScreen implements Screen {
	private GameWorld world;
	private GameRenderer renderer;
	
	public GameScreen() {
		world = new GameWorld();
		renderer = new GameRenderer(world);
	}
	@Override
	public void render(float delta) {
		// Draws the RGB color 10, 15, 230, at 100% opacity
        Gdx.gl.glClearColor(10/255.0f, 15/255.0f, 230/255.0f, 1f);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        float screenWidth = Gdx.graphics.getWidth();
        float screenHeight = Gdx.graphics.getHeight(); 
        float gameWidth = 136;
        float gameHeight = screenHeight / (screenWidth / gameWidth);
        
		world.update(delta);
		renderer.render();
		Gdx.input.setInputProcessor(new InputHandler(world, screenWidth / gameWidth, screenHeight / gameHeight));
	}

	@Override
	public void resize(int width, int height) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void show() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void hide() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}
	
}
